from django.db import models

from mars.apps.users.models import User
from mars.utils.models import BaseModel

# from users.models import User



# Create your models here.
class OAuthMPUser(BaseModel):
    """小程序用户"""

    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="用户")
    openid = models.CharField(max_length=128, verbose_name="用户唯一标识(OpenID)", db_index=True)
    nickname = models.CharField(default="", max_length=32, null=True, blank=True, verbose_name="昵称")
    unionid = models.CharField(max_length=128,verbose_name="微信开放平台用户唯一标识(UnionID)")

    class Meta:
        db_table = "tb_oauth_mp"
        verbose_name = "小程序用户数据"
        verbose_name_plural = verbose_name
